<help:link Id="66545">Asc Function [Runtime]</help:link>
</p>
<p class="Paragraph">Returns the ASCII value (American Standard Code for Information Interchange) of the first character in a string expression.</p>
</help:to-be-embedded>
<p class="Paragraph">
<span class="T1">Syntax</span>:</p>
<p class="Paragraph">Asc (Text As String) <help:key-word value="Asc" tag="kw66545_1" xmlns:help="http://openoffice.org/2000/help"/>
</p>
<p class="Paragraph">
<span class="T1">Return value</span>:</p>
<p class="Paragraph">Integer</p>
<p class="Paragraph">
<span class="T1">Parameter</span>:</p>
<p class="Paragraph">Text: Any valid string expression. Only the first character in the string is relevant.</p>
<p class="Paragraph">The Asc function is often used to replace keys with values; thus more or less representing the reverse of the <span class="T1">Chr$</span> function. If a string is blank in the Asc function, OpenOffice.org Basic reports a run-time error. In addition to printable ASCII characters (Codes 32-255), the ASCII function can also be used to detect non-printable key codes in ASCII code.</p>
<p class="Paragraph">
<span class="T1">Example:</span>
</p>
<p class="PropText">Sub ExampleASC</p>
<p class="PropText">Print ASC("A") REM returns 65</p>
<p class="PropText">Print ASC("Z") REM returns 90</p>
<p class="PropText">Print ASC("Las Vegas") REM returns 76, since only the first character is taken into account</p>